<div data-title="Command Line" style="height: 100%;">
  <div class="input-group" style="margin-top: 5px;">
    <span class="input-group-addon">mos&nbsp;&gt;</i></span>
    <input required id="terminal-input"
      placeholder="Type command and press enter ..." class="form-control" type="text">
  </div>
</div>

<script>
  $(document).ready(function() {
    $('#terminal-input').focus();
  });
  $(document).off('keydown', '#terminal-input');
  $(document).on('keydown', '#terminal-input', function(ev) {
    if (ev.keyCode == 13) {
      var text = $('#terminal-input').val() || '';
      if (!text) return;
      $.ajax({ url: '/terminal', data: { cmd: text } }).then(function(data) {
      });
    }
  });

</script>
